package com.atguigu.demo.order.controller;

import com.atguigu.demo.order.bean.OrderInfo;
import com.atguigu.demo.order.service.OrderInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 订单表 订单表 前端控制器
 * </p>
 *
 * @author zhangchen
 * @since 2023-07-19
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class OrderInfoController {

    @Autowired
    OrderInfoService orderInfoService;


    @GetMapping("/orderinfo/{order_id}")
    public OrderInfo getOrderById(@PathVariable("order_id") Integer orderId){
        log.debug("orderId = " + orderId);

        OrderInfo orderInfo = orderInfoService.getById(orderId);
        return orderInfo;

    }


}
